package com.ashlikun.flutter_anim_test

import android.util.Log
import android.view.View
import android.widget.Toast
import androidx.fragment.app.FragmentActivity
import com.ashlikun.flutter_anim_test.pigeons.PigeonsConfig
import io.flutter.plugin.common.EventChannel
//import io.flutter.plugin.common.MethodChannel

/**
 * 作者　　: 李坤
 * 创建时间: 2025/1/22　15:08
 * 邮箱　　：496546144@qq.com
 *
 * 功能介绍：
 */
class Page1Activity : FragmentActivity() {
    override fun onCreate(savedInstanceState: android.os.Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_page1)
//        findViewById<View>(R.id.btn_page1).setOnClickListener {
//            MainActivity.methodChannel?.invokeMethod("getDartData1", null, object : MethodChannel.Result {
//                override fun success(result: Any?) {
//                    Toast.makeText(this@Page1Activity, result.toString(), Toast.LENGTH_SHORT).show()
//                }
//
//                override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) {
//                }
//
//                override fun notImplemented() {
//                }
//            })
//        }
//        findViewById<View>(R.id.btn_page2).setOnClickListener {
//            PigeonsConfig.api.callFlutterMethod("page1") {
//                Log.e("Page1Activity", "callFlutterMethod: ${it.getOrNull()}")
//            }
////            MainActivity.eventChannel?.setStreamHandler(object : EventChannel.StreamHandler {
////                override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
////                }
////
////                override fun onCancel(arguments: Any?) {
////                }
////            })
//        }

    }
}